//
//  EmptyView.swift
//  codelabs
//
//  Created by 雷雷 on 26/05/2025.
//

import SwiftUI

struct EmptyView: View {
    var message:String? = "Not found"
    var imageName:String = "exclamationmark.bubble.fill"
    
    var body: some View {
        VStack(alignment:.center){
            
            Image(systemName: imageName)
                .resizable()
                .frame(width:40,height:40)
                .scaledToFit()
                .foregroundColor(.gray)
            
            if message?.isEmpty == false {
                Text(message!)
                    .font(.headline)
                    .foregroundColor(.gray)
                    .padding(.vertical)
            }
        }
    }
}

#Preview {
    EmptyView()
}
